<%@include file="../../context.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Annual Price Data List</title>
<%@include file="../common_Admin_imports.jsp"%>
<%@include file="../common_list_page.jsp"%>
<script type="text/javascript">
	$(document)
			.ready(
					function() {
						resetSelectAll();
						$('#selectAll').on('click', function() {
							selectAll();
						});
						paginationNextBtn("${pageContext.request.contextPath}/admin/annualpricedata/list.html?totalRecords=${annualySharePriceDataPage.totalNoOfRecords}&page=");

					});

	function deleteFiltered() {
		var proceed = confirm("Are you sure, you want to delete the searched dataset ? If you select yes, the operation cannot be undone");
		if (proceed) {
			var baseUrl = "${pageContext.request.contextPath}/admin/annualpricedata/deleteFiltered.html";
			document.location = baseUrl;
		}

		return proceed;
	}
</script>

<style type="text/css">
.datepicker,.searchSelector {
	margin-right: 10px;
	width: 100px;
}

.searchSelector {
	margin-right: 10px;
	width: 150px;
}

.btnSerch {
	padding: 4px;
}
</style>
</head>
<body>
	<div class="main_wrapper">
		<div class="header_wrapper">
			<div class="container-fluid">
				<div class="header_inner_wrapper clearfix">
					<div class="row-fluid">
						<div class="header_left span4">List of Annual Price Data !</div>
						<div class="header_right span8">
							<!-- search section -->
							<jsp:include page="../search.jsp">
								<jsp:param name="page" value="annualpricedata" />
							</jsp:include>
							<!-- end of search section -->
						</div>
					</div>
				</div>
			</div>

			<div class="row-fluid">
				<div class="main_table">
					<form:form method="POST"
						action="${pageContext.request.contextPath}/admin/annualpricedata/delete/selected.html">
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th id="tableHeader"><input type="checkbox" id="selectAll"
										name="deleteHeader" /></th>
									<th id="tableHeader">No</th>
									<th id="tableHeader">Company Name</th>
									<th id="tableHeader">Date</th>
									<th id="tableHeader">Share Price</th>
									<th id="tableHeader">high</th>
									<th id="tableHeader">low</th>
									<th id="tableHeader">turnOver</th>
									<th id="tableHeader">volume</th>
									<th id="tableHeader">no Of Trade</th>
									<th id="tableHeader">Opening Price</th>
									<th></th>
									<th></th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="annualPriceData"
									items="${annualySharePriceDataPage.pageData}">
									<tr>
										<td><input type="checkbox" class="selectedId"
											name="deleteIds" value="${annualPriceData.id}" /></td>
										<td>${annualPriceData.id}</td>
										<td>${annualPriceData.company.name}</td>
										<td id="dateAlign"><fmt:formatDate
												pattern="${dateFormat}" value="${annualPriceData.date}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.sharePrice}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.high}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.low}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.turnOver}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.volume}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.noOfTrade}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${annualPriceData.openingPrice}" /></td>
										<td><a class="btn btn-info"
											href="${pageContext.request.contextPath}/admin/annualpricedata/edit/${annualPriceData.id}.html">Edit</a>
										</td>
										<td><a class="btn btn-danger"
											lang="${pageContext.request.contextPath}/admin/annualpricedata/delete/${annualPriceData.id}.html"
											href="javascript:void(0);"
											onclick="return confirmAndDelete(this);">Delete</a></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<div>
							<div>
								<input
									onclick="return confirm('Are you sure, you want to delete all the selected results. This opperation cannot be undone');"
									class="btn btn-danger" type="submit" value="Delete Selected" />
								<input onclick="return deleteFiltered();" class="btn btn-danger"
									type="button" value="Delete Filtered List" />
							</div>
						</div>
					</form:form>
					<!-- paging section -->
					<div class="pagination pagination-right">
						<!-- page number -->
						Page&nbsp;<input
							value="${annualySharePriceDataPage.currentPageNo}"
							style="width: 50px;" type="number" min="0"
							max="${annualySharePriceDataPage.totalNoOfPages }" id="pageNum">
						<!-- end page number -->
						<ul>
							<li><c:if test="${annualySharePriceDataPage.showPrev}">
									<a
										href="${pageContext.request.contextPath}/admin/annualpricedata/list.html?page=${annualySharePriceDataPage.currentPageNo-1}&totalRecords=${annualySharePriceDataPage.totalNoOfRecords}">Prev</a>
								</c:if></li>
							<c:forEach begin="${annualySharePriceDataPage.startPageNo}"
								var="page" end="${annualySharePriceDataPage.endPageNo}">
								<li><a
									<c:if test="${annualySharePriceDataPage.currentPageNo==page}">style="background-color:#79BAEC"</c:if>
									href="${pageContext.request.contextPath}/admin/annualpricedata/list.html?page=${page}&totalRecords=${annualySharePriceDataPage.totalNoOfRecords}">${page}</a></li>&nbsp;
							</c:forEach>
							<li><c:if test="${annualySharePriceDataPage.showNext}">
									<a
										href="${pageContext.request.contextPath}/admin/annualpricedata/list.html?page=${annualySharePriceDataPage.currentPageNo+1}&totalRecords=${annualySharePriceDataPage.totalNoOfRecords}">Next</a>
								</c:if></li>
							<li><a class="pageCountLink">${annualySharePriceDataPage.totalNoOfPages }
									Pages</a></li>
						</ul>

					</div>
					<div>
						<br></br>
					</div>
					<!-- paging section -->
					<a class="btn btn-success"
						href="${pageContext.request.contextPath}/admin/annualpricedata/add.html">New</a>
				</div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>